package 均分纸牌;

import java.util.Scanner;

public class Main {
    static int N = 110;
    static int[] a = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            a[i] = in.nextInt();
            sum += a[i];
        }
        int avg = sum / n, x = 0, res = 0;
        for (int i = 1; i < n; i++) {
            x = a[i] - avg + x;
            if (x != 0) {
                res++;
            }
        }
        System.out.println(res);
    }
}
